{% extends "::base.html.twig" %}

{% block body %}
<h1>Personal</h1>

<table class="table">
    <tbody>
        <tr>
            <th>Id</th>
            <td>{{ entity.id }}</td>
        </tr>
        <tr>
            <th>Pib</th>
            <td>{{ entity.pib }}</td>
        </tr>
        <tr>
            <th>Birthday</th>
            <td>{{ entity.birthday|date('Y-m-d') }}</td>
        </tr>
        <tr>
            <th>Devices</th>
            <td>
                <ul>
                    {% for device in devices %}
                    <li><a href="{{ path('device_show', { 'id' : device.id }) }}">{{ device.inv }}</a></li>
                    {% endfor %}
                </ul>
            </td>
        </tr>
    <tr>
        <th>Department</th>
        <td><a href="{{ path('department_show', {'id' : entity.department.id}) }}">
            {{ entity.department.name }}
        </a>
        </td>
    </tr>
    </tbody>
</table>

<ul class="record_actions">
    <li>
        <a href="{{ path('personal') }}" >
            Back to the list
        </a>
    </li>
    <li>
        <a href="{{ path('personal_edit', { 'id': entity.id }) }}" >
            Edit
        </a>
    </li>
    <li>
        <form action="{{ path('personal_delete', { 'id': entity.id }) }}" method="post">
            {{ form_widget(delete_form) }}
            <button type="submit" >Delete</button>
        </form>
    </li>
</ul>
{% endblock %}
